Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 7 - View-Related Objects / About View Group Objects


Onscreen and Offscreen View Groups

QuickDraw GX creates one view group for you: the onscreen view group, whose reference is defined by the gxScreenViewDevices constant. It includes all physical screen devices. You draw to view ports in this view group for all onscreen drawing. If a transform object's view port list property is not changed from its default value, the only view port in the list is the default view port, which is in this view group. Thus, by default, shapes are drawn onscreen to view ports and onto view devices in this view group.

You can also create any number of offscreen view groups. For example, you can build an image by creating an offscreen view group that mirrors the onscreen view group and draw into view ports and onto view devices exactly as the drawing is done with the onscreen view group. The only difference is that your shapes appear in the bitmap of your offscreen view devices instead of onscreen. When you are ready to transfer those drawn shapes to the screen, you can draw the bitmaps of the offscreen view devices as bitmap shapes into view ports in the onscreen view group.

Clipping and Offscreen Drawing
For onscreen view ports attached to windows, QuickDraw GX takes care of restricting drawing to each window's visible areas, even in cases where windows overlap. When you create an offscreen view group with offscreen view ports, you need to take care of all clipping yourself, including cases in which view ports in different hierarchies overlap and those in front must clip those behind.
To help you track all view ports and view devices for all onscreen and offscreen view groups, QuickDraw GX provides another predefined view group reference, defined by the gxAllViewDevices constant. You use it to specify all view groups when you want a list of all view ports or all view devices in all view groups. You cannot use this constant to set a view port or view device because gxAllViewDevices does not actually refer to a specific view group.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996